package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the INVE_TB database table.
 * 
 */

@Entity
@Table(name="INVE_TB")
@NamedQuery(name="InveTb.findAll", query="SELECT i FROM InveTb i")
public class InveTb implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(initialValue=12,allocationSize=1,name="INVE_TB_INVEID_GENERATOR", sequenceName="SEQ_26")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="INVE_TB_INVEID_GENERATOR")
	@Column(name="INVE_ID")
	private long inveId;//主键

	@Column(name="INVE_PRO_NUMB")
	private BigDecimal inveProNumb;//数量

	//bi-directional many-to-one association to Product
	@OneToMany(mappedBy="inveTb")
	private List<Product> products;

	public InveTb() {
	}

	public long getInveId() {
		return this.inveId;
	}

	public void setInveId(long inveId) {
		this.inveId = inveId;
	}



	public BigDecimal getInveProNumb() {
		return this.inveProNumb;
	}

	public void setInveProNumb(BigDecimal inveProNumb) {
		this.inveProNumb = inveProNumb;
	}









	public List<Product> getProducts() {
		return this.products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}

	public Product addProduct(Product product) {
		getProducts().add(product);
		product.setInveTb(this);

		return product;
	}

	public Product removeProduct(Product product) {
		getProducts().remove(product);
		product.setInveTb(null);

		return product;
	}

}